package com.example.nacostest.Controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

/**
 * @author xufeng
 * @description: TODO
 * @date 2022-04-01 16:32
 */
@RestController
@RequestMapping("/client")
public class RestClientController {

    @Autowired
    private RestTemplate restTemplate;

    @GetMapping("/version")
    public String client() {
        return restTemplate.getForObject("http://mesh-server.DEFAULT_GROUP.public.nacos:11000/server/info", String.class);
    }
}
